﻿@{
    ViewBag.ActiveMenu = "Home"; //The menu item will be active for this page.
}
<div>
    @*<h1>@L("WellcomeMessage")!</h1>
    <p class="lead">@L("Home_ThisIsATemplate")</p>*@
    <div class="row" style="display:none;">
        <div class="col-md-4">
            <h3>ASP.NET MVC</h3>
            <p>
                @L("Home_AspNetDescription")
            </p>
            <a class="btn btn-primary btn-sm" href="http://asp.net/mvc">@L("LearnMore")..</a>
        </div>
        <div class="col-md-4">
            <h3>ASP.NET Boilerplate</h3>
            <p>
                @L("Home_AspNetBoilerplateDescription")
            </p>
            <a class="btn btn-primary btn-sm" href="http://aspnetboilerplate.com">@L("LearnMore")..</a>
        </div>
        <div class="col-md-4">
            <h3>@L("Others")</h3>
            <p>
                @L("Home_OtherTools")
            </p>
        </div>
    </div>
    <div class="row">
        <div class="col-md-4">
            <h3>班级学生统计</h3>
            <p>
                <table style="width:500px;">
                    <thead>
                        <tr>
                            <th>班级名称</th>
                            <th>学生人数</th>
                        </tr>
                    </thead>
                    <tbody class="person">
                        @*@foreach (var v in ViewData["list"] as List<ClassDto>) { 
                         <tr>
                             <td>@v.name</td>
                             <td>@v.studentNum</td>
                         </tr>
                        }*@
                    </tbody>
                </table>
            </p>
        </div>
    </div>
</div>
<script src="~/Scripts/jquery-2.1.4.js"></script>
<script>
    $(function () {
        $.ajax({
            url: "/api/services/APP/Class/GetClassSummry",
            type: "post",
            success: function (data) {
                //alert(JSON.stringify(data));
                var str = "";
                for (var i = 0; i < data.result.length; i++) {
                    str += "<tr>";
                    str += "<td>" + data.result[i].name + "</td>";
                    str += "<td>" + data.result[i].number + "</td>";
                    str += "</tr>";
                }
                $(".person").html(str);
            },
            error: function (data) {
                //alert(JSON.stringify(data));
            }

        });
    });

</script>